package com.tutu.feign.feignclient;

import com.tutu.commons.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @Program: SpringCloud
 * @Description: openfeign调用User-server服务的客户端
 * @Author: JK.TuTu
 * @ @Version: 1.0
 * @Create: 2022-12-01 21:25
 **/
//user-server为需要调用服务的名称  fallback为重写方法的类
@FeignClient(value = "user-server")
public interface UserClient {

    @GetMapping("/user/{uid}")  //需要和调用方法的请求路径请求方法保持一致
    User findUserById(@PathVariable("uid") int uid);

}
